<template>
    <div>
        <component :is="listTableComponent" ref="listTable" @showDialog="showDialog" v-bind="$attrs" v-on="$listeners"/>
        <create-dialog :visible.sync="visible" v-if="visible" :row="currRow" @reloadList="query"></create-dialog>
        <detail-dialog :visible.sync="detailVisible" v-if="detailVisible" :row="currRow" @reloadList="query" v-bind="$attrs" v-on="$listeners"></detail-dialog>
    </div>
</template>
<script>
    import openDialog from "@/mixins/openDialog";
    import ApproverList from '../../components/WorkFlowsDialog/Case/ApproverList'
    import CreateDialog from '@/components/WorkFlowsDialog/CreateDialog'
    import DetailDialog from '@/components/WorkFlowsDialog/DetailDialog'
    import common from "@/mixins/common";
    // 通过定义一个函数的方式来引入，传入一个参数，返回组件。
    export default {
        name: "TabContent",
        components: {  DetailDialog, CreateDialog,  ApproverList},
         mixins:[openDialog,common],
        data() {
            return {
                listTableComponent:null  // 定义组件
            }
        },
        watch:{
        },
        created() {
          this.getComponment(this.listTablePath)
        },
        mounted() {
        },
        computed: {
        },
        methods: {
            getComponment(value){
              let table = null;
              table = require("@/views/"+value+"/ListTable");
              this.listTableComponent=table.default
            },
            query() {
                this.$refs["listTable"].getList();
            },
        }
    }
</script>
<style lang="scss" scoped>
    .detailFormBox{
        ::v-deep.el-form{
            margin-right: 30px;
        }
    }
</style>
